//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
#ifndef PKT_CMD_2ARG_REPLY_H
#define PKT_CMD_2ARG_REPLY_H



#pragma pack(push) 
#pragma pack(1)
class PktCmd2ArgReply : public VxPktHdr
{
public:
	PktCmd2ArgReply()
	{
		m_u16PktType = PKT_TYPE_CMD_2ARG_REPLY;
		m_u16PktLen = sizeof( PktCmd2ArgReply );
		u16Cmd = (U16)-1;
		u32Error = 0;
		u32Arg2 = 0;
		as8Arg1[ 0 ] = 0;

		vx_assert( 0 == (m_u16PktLen & 0x0f ) );
	}
	void CalcPktLen( void )
	{
		//calculate length of packet from length of file data
		m_u16PktLen = (unsigned short)ROUND_TO_16BYTE_BOUNDRY( sizeof( PktCmd1ArgReq ) - MAX_ARG_LEN  + strlen( as8Arg1 )+1 );
	}
	unsigned short u16Cmd;		// type of command
	unsigned long u32Error;		// error if any
	unsigned long u32Arg2;		// arg2
	char as8Arg1[ (MAX_ERR_MSG_LEN + 1) ]; //error message or argument
};
#pragma pack(pop)


#endif //#ifndef PKT_2ARG_REPLY_H




